import request from '../utils/request.js'

// 获取毕业设计题目列表信息
export function getCourseList () {
  return request({
    url: '/api/courselist.php',
    method: 'get'
  })
}
// 注册登录接口
export function login (namecode, pwd) {
  return request({
    url: '/api/login.php',
    method: 'post',
    // params: {
    //   namecode: namecode,
    //   password: pwd
    // }
    data: {
      namecode: namecode,
      password: pwd
    }
  })
}
// 获取用户信息接口
export function getUserInfo (namecode) {
  return request({
    url: '/api/getUserInfo.php',
    method: 'post',
    data: {
      namecode: namecode
    }
  })
}
// 更新用户信息
export function updateUserInfo (namecode, username, classname) {
  return request({
    url: '/api/updateUserInfo.php',
    method: 'post',
    data: {
      namecode: namecode,
      username: username,
      classname: classname
    }
  })
}
// 选择毕设题目
export function selectCourse (namecode, cid) {
  return request({
    url: '/api/selectCourse.php',
    method: 'post',
    data: {
      namecode: namecode,
      cid: cid
    }
  })
}
export function insertSid (tid, sid) {
  return request({
    url: '/api/insertSid.php',
    method: 'post',
    data: {
      tid: tid,
      sid: sid
    }
  })
}
